//
//  LuckDrawViewController.m
//  抽奖
//
//  Created by 蓓蕾 on 2021/11/4.
//  Copyright © 2021 亿缘. All rights reserved.
//

#import "LuckDrawViewController.h"
#import "Luck.h"

@interface LuckDrawViewController ()<CAAnimationDelegate,LuckDelegate>

@end

@implementation LuckDrawViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    [self initLuckView];
}

-(void)initLuckView
{
    Luck *luck = [[Luck alloc] initWithFrame:CGRectMake(0, 200, self.view.frame.size.width, self.view.frame.size.width)];
    luck.imageArray =  [@[@"https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=835690938,1433234559&fm=26&gp=0.jpg",@"https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1132859755,2898066700&fm=26&gp=0.jpg",@"https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=3902436073,1089717092&fm=26&gp=0.jpg",@"https://ss3.bdstatic.com/70cFv8Sh_Q1YnxGkpoWK1HF6hhy/it/u=835690938,1433234559&fm=26&gp=0.jpg",@"https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2043797193,3540976039&fm=26&gp=0.jpg",@"https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=3902436073,1089717092&fm=26&gp=0.jpg",@"https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1802555014,204234422&fm=26&gp=0.jpg",@"https://ss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=2043797193,3540976039&fm=26&gp=0.jpg"]mutableCopy];
    
    // 概率数组
    luck.luckArr =[NSArray arrayWithObjects:@"90",@"100",@"200",@"300",@"10",@"50",@"50",@"200",nil];
    // 基础循环次数
    luck.circleNum = 3;
    luck.delegate = self;
    [self.view addSubview: luck];
}

- (void)luckSelectBtn:(UIButton *)btn{
//    NSLog(@"%ld",btn.tag);
}

- (void)luckViewDidStopWithArrayCount:(NSInteger)count{
    NSLog(@"%ld",count);
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
